package com.guigu.tankai.service.impl;

import com.guigu.liuyunan.mapper.OrdersettingMapper;
import com.guigu.liuyunan.pojo.Ordersetting;
import com.guigu.tankai.service.OrderSettingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OrderSettingServiceImpl implements OrderSettingService {

    @Autowired
    OrdersettingMapper om;


    @Override
    public Ordersetting OrderSettingInfo(Ordersetting ordersetting) {
        return om.selectByPrimaryKey(ordersetting.getOrderdate());
    }

    @Override
    public int UpAndAddOrderSetting(Ordersetting ordersetting) {
        if (om.selectByPrimaryKey(ordersetting.getOrderdate())!=null){
            return     om.updateByPrimaryKey(ordersetting);
        }else {
            return    om.insert(ordersetting);
        }
    }

    @Override
    public Ordersetting yyorderSetting(String date) {
        return om.selectByPrimaryKey(date);
    }
}
